package com.wandong.cinema.entity;

public class Movie {
    private String movieId;
    private String name;
    private String director;
    private String actor;
    private String introduction;
    private int duration;
    private double score;
    private String type;
    private String releaseDate;

    public Movie(String movieId, String name, String director, String actor, String introduction, 
                 int duration, double score, String type, String releaseDate) {
        this.movieId = movieId;
        this.name = name;
        this.director = director;
        this.actor = actor;
        this.introduction = introduction;
        this.duration = duration;
        this.score = score;
        this.type = type;
        this.releaseDate = releaseDate;
    }

    public String getMovieId() {
        return movieId;
    }

    public void setMovieId(String movieId) {
        this.movieId = movieId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public String getActor() {
        return actor;
    }

    public void setActor(String actor) {
        this.actor = actor;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        if (score < 0 || score > 10) {
            throw new IllegalArgumentException("评分必须在0-10分之间");
        }
        this.score = score;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getReleaseDate() {
        return releaseDate;
    }

    public void setReleaseDate(String releaseDate) {
        this.releaseDate = releaseDate;
    }

    @Override
    public String toString() {
        return String.format("影片ID: %s, 名称: %s, 类型: %s, 导演: %s, 主演: %s, 时长: %d分钟, 评分: %.1f, 上映日期: %s",
                movieId, name, type, director, actor, duration, score, releaseDate);
    }
}
